<?php defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); ?>

<script language="javascript" type="text/javascript">
    function submitbutton(pressbutton) {
        var form = document.adminForm;
        if (pressbutton == 'cancel') {
            submitform( pressbutton );
            return;
        }

        if (form.team_name.value == ""){
            alert('Must have a name');
        }
        else {
            submitform( pressbutton );
        }
    }
</script>

<form action="index2.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
    <table cellpadding="4" cellspacing="0" border="0" width="100%">
        <tr>
            <td width="100%"><span class="sectionname"><?php echo $this->row->getID() ? $this->row->getName() : 'Create a new Team'; ?></span></td>
        </tr>
    </table>

    <?php
        $ptabs = new mosTabs(0);
        $ptabs->startPane("com_leagueman");
        $ptabs->startTab("General", "General-page");
    ?>
    <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
        <tr>
            <td width="15%" align="right"><?php label('Name:'); ?></td>
            <td width="85%">
                <input class="inputbox" type="text" name="team_name" size="64" maxlength="64" value="<?php echo $this->row->getName(); ?>" />
            </td>
        </tr>
        <tr>
            <td align="right"><?php label('ShortName:'); ?></td>
            <td>
                <input class="inputbox" type="text" name="team_name_short" size="64" maxlength="64" value="<?php echo $this->row->getShortName(); ?>" />
            </td>
        </tr>
        <tr>
            <td align="right"><?php label('Club:'); ?></td>
            <td>
                <?php echo $this->plugin("leagueman_list", "clubs", "team_club", $this->row->team_club); ?>
            </td>
        </tr>
        <tr>
            <td align="right"><?php label('Logo:'); ?></td>
            <td>
                <input type="file" name="upload" size="40" />
            </td>
        </tr>
        <tr>
            <td align="right"><?php label('Info:'); ?></td>
            <td>
                <input class="inputbox" type="text" name="team_info" size="64" maxlength="64" value="<?php echo $this->row->getInfo(); ?>" />
            </td>
        </tr>
        <tr>
            <td align="right">&nbsp;</td>
            <td>
                <?php $this->plugin("thumb", "logos", $this->row->getLogo(), 100, 100); ?>
            </td>
        </tr>
    </table>
    <?php
        $ptabs->endTab();
        $ptabs->startTab("Description", "Description-page");
    ?>
        <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
            <tr>
                <td width="80%">
                    <textarea name="team_text" rows="15" cols="100" class="text_area"><?php echo $this->row->getText(); ?></textarea>
                </td>
            </tr>
        </table>
    <?php
        $ptabs->endTab();
        $ptabs->endPane();
    ?>


    <input type="hidden" name="team_id" value="<?php echo $this->row->getID(); ?>" />
    <input type="hidden" name="option" value="com_leagueman" />
    <input type="hidden" name="act" value="teams" />
    <input type="hidden" name="task" value="" />
</form>